//工具
let tool = {
    on: function (element, type, func) {
        if (element.addEventListener) {
            element.addEventListener(type, func, false); //false 表示冒泡
        } else if (element.attachEvent) {
            element.attachEvent('on' + type, func);
        } else {
            element['on' + type] = func;
        }
    },
    getPageHeight: function (element) {
        return element.scrollHeight;
    },
    // 获取页面卷去的高度
    getScrollTop: function (element) {
        return element.scrollTop;
    },
    // 获取页面可视区域宽度
    getClientHeigth: function (element) {
        return element.clientHeight;
    },
    timer: null,
    timer2: null
};